#pragma once 
#include <iostream>
using namespace std;

template <class Iterator, class Ref,class Ptr> 
struct ReverseIterator
{
	typedef ReverseIterator<Iterator, Ref, Ptr> Self;
	ReverseIterator(Iterator it)
	:_con(it)
	{}
	Iterator _con;

	Self& operator++()
	{
		_con--;
		return *this;
	}
	Self operator++(int)
	{
		Iterator tmp = _con;
		_con--;
		return tmp;
	}

	Ref operator*()
	{
		Iterator cur = _con;
		return *(--cur);
	}

	Ptr operator->()
	{
		return &(operator*());
	}
	bool operator !=(const Self& s)
	{
		return _con != s._con;
	}

	bool operator ==(const Self& s)
	{
		return _con == s._con;
	}

};

